Jx.categorize('unit.dimension', {

	$extend: 'unit.integer',
	
	$accessors: {
		
		unit: 'px'
		
	},
	
	numericDimensionRe: /^([0-9]+(\.[0-9]+)?)([^0-9][0-9a-z]+)$/i,
	
	unitRe: /^[^0-9][0-9a-z]+$/,
	
	onSetValue: function(operation, value){
		
		var unit = operation.unit;
		
		if (unit){
			
			this.setUnit(unit);
			
		}
		
		this.$super(arguments);
		
	},
	
	allowSetValue: function(operation, value){
		
		operation.unit = void(0);
		
		if (Jx.isString(value, true) &&
			 
			(m = value.match(this.numericDimensionRe))
			
		){
			
			value = parseFloat(m[1]);
			
			operation.unit = m[3];
			
		}

		return this.$super([ operation, value ]);
		
	},
	
	allowSetUnit: function(operation, unit){

		return Jx.isString(unit) && this.unitRe.test(unit);
		
	},
	
	toString: function(radix){
		
		return this.$super([ radix ]) + this.getUnit();
		
	}
	
	

});
